feat!: pretty-printed output for list commands#8
Open
onefloid wants to merge 1 commit into
Open
Conversation
`list` commands (cube, dimension, process, subset, view) now print each item as a `-` bullet by default, instead of one plain name per line. Pass --output-raw to get the old plain output back, e.g. for scripting. Extracted the shared "resolve database, open TM1Service, call get_all_names(), print" logic into a new generic_list() helper in tm1cli/utils/generic.py, mirroring execute_exists()'s pattern (including its connection-error handling). All five list commands now delegate to it; the per-command files no longer need TM1Service or resolve_database directly. Also fixes MockedCubeService.get_all_names()'s mocked parameter name (cube_name -> skip_control_cubes) to match the real TM1py signature now that generic_list() calls it by keyword, and adds a get_all_names mock for MockedProcessService plus a mocked test_process_list test (process list previously had no mocked coverage at all). BREAKING CHANGE: default stdout of `tm1cli <resource> list` (and its ls alias) is no longer plain one-item-per-line output; scripts relying on that must add --output-raw. Bump version to 0.2.1 and update CHANGELOG.md / README.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
listcommands (cube, dimension, process, subset, view) now print each item as a-bullet by default, instead of one plain name per line. Pass --output-raw to get the old plain output back, e.g. for scripting.Extracted the shared "resolve database, open TM1Service, call get_all_names(), print" logic into a new generic_list() helper in tm1cli/utils/generic.py, mirroring execute_exists()'s pattern (including its connection-error handling). All five list commands now delegate to it; the per-command files no longer need TM1Service or resolve_database directly.
Also fixes MockedCubeService.get_all_names()'s mocked parameter name (cube_name -> skip_control_cubes) to match the real TM1py signature now that generic_list() calls it by keyword, and adds a get_all_names mock for MockedProcessService plus a mocked test_process_list test (process list previously had no mocked coverage at all).
BREAKING CHANGE: default stdout of
tm1cli <resource> list(and its ls alias) is no longer plain one-item-per-line output; scripts relying on that must add --output-raw.Bump version to 0.2.1 and update CHANGELOG.md / README.md.